package org.example.exception;


import lombok.NoArgsConstructor;
import lombok.ToString;


@NoArgsConstructor
@ToString
public class AppException extends RuntimeException {
    private Integer code=500;
    private String message="服务器内部出错";
    public AppException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public AppException(AppExceptionCodeMsg codeMsg) {
        this.code=codeMsg.getCode();
        this.message=codeMsg.getMsg();
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
